import http from "../http.ts"
import {getUserId} from "../../store";

export const getChat = (content, page) => {
    return http.get( "/chat?content=" + content + "&pageId=" + page + "&userId=" + getUserId(), {
        msg: false,
        token: true,
        load: false,
        headers: {
            "Accept": 'text/event-stream',
            "content-type": 'application/json',
        },
        onDownloadProgress: (e) => {
            console.log(e)
        }
    })

}

export const testChat = (from) => {
    return http.post("/chat", from,{
        msg: false,
        token: true,
        load: false,
    })
}